// src/features/workspaces/api/useGetMembers.ts
import {MARK_DATA_URL} from "@/lib/social/constants";

interface Props {
    wid?: string
    uid?: string
}

export const useGetMembers = async ({wid, uid}: Props) => {
    const res = await fetch(
        // `${MARK_DATA_URL}/members?workspaceId=${wid}&userId=${uid}`,
        `/api/members?workspaceId=${wid}&userId=${uid}`,
    )
    let data = await res.json()
    // data = data.members
    const isLoading = data === undefined

    return {data, isLoading}
}